﻿CREATE TABLE [dbo].[Usuario_Permiso] (
    [Id]        INT IDENTITY (1, 1) NOT NULL,
    [EmpresaId] INT NOT NULL,
    [PermisoId] INT NOT NULL,
    [UsuarioId] INT NOT NULL,
    CONSTRAINT [PK_PermisoXUsuario] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_PermisoXUsuario_Empresa] FOREIGN KEY ([EmpresaId]) REFERENCES [dbo].[Empresa] ([Id]),
    CONSTRAINT [FK_PermisoXUsuario_Permiso] FOREIGN KEY ([PermisoId]) REFERENCES [dbo].[Permiso] ([Id]),
    CONSTRAINT [FK_PermisoXUsuario_Usuario] FOREIGN KEY ([UsuarioId]) REFERENCES [dbo].[Usuario] ([Id])
);

